-- GENERATED SPELL FOR [Phase Hunter] --


function spell0_18879(pUnit, Event) --@De-Materialize,Self--
pUnit:FullCastSpellOnTarget(34814,pUnit)
pUnit:RegisterEvent('Sorts_18879', 570, 1)
end

function spell1_18879(pUnit, Event) --@Mana Burn,n/a--
pUnit:FullCastSpellOnTarget(13321,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18879', 3000, 1)
end

function spell2_18879(pUnit, Event) --@Materialize,Self--
pUnit:FullCastSpellOnTarget(34804,pUnit)
pUnit:RegisterEvent('Sorts_18879', 640, 1)
end

function spell3_18879(pUnit, Event) --@Phase Slip,Self--
pUnit:FullCastSpellOnTarget(36574,pUnit)
pUnit:RegisterEvent('Sorts_18879', 8325, 1)
end

function Sorts_18879(pUnit, Event)
local choix_sorts_18879 = math.random(0, 3)
if choix_sorts_18879 == 0 then
pUnit:RegisterEvent('spell0_18879', 1, 1)
end
if choix_sorts_18879 == 1 then
pUnit:RegisterEvent('spell1_18879', 1, 1)
end
if choix_sorts_18879 == 2 then
pUnit:RegisterEvent('spell2_18879', 1, 1)
end
if choix_sorts_18879 == 3 then
pUnit:RegisterEvent('spell3_18879', 1, 1)
end
end

function mob18879_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18879', math.random(1500, 3000), 1)
end

function mob18879_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18879_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18879_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18879, 1, 'mob18879_Action')
RegisterUnitEvent(18879, 2, 'mob18879_Leave')
RegisterUnitEvent(18879, 3, 'mob18879_Kill')
RegisterUnitEvent(18879, 4, 'mob18879_Die')
